<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <script type="text/javascript" src="javascripts/jquery.min.js"></script>
    <script type="text/javascript">
    	function doUpload() {  
		    let formData = new FormData();
			formData.append("timestamp",'2017-09-24');
			formData.append("image", $('#uploadForm')[0].files[0]);
		    $.ajax({  
		        url: 'http://localhost:3000/file/admin/upload',  
		        type: 'POST',  
		        data: formData,
		        async: false,  
		        cache: false,  
		        contentType: false,  
		        processData: false,
			    xhrFields: {
			        withCredentials: true
		        },  
		        success: function (data) {  
		            console.log(data);  
		        },  
		        error: function (err) {  
		            console.log(err);  
		        }  
		    });  
		}
    </script>
</head>
<body>
	<!-- <form>  
	    <input type="file" id="uploadForm"/>
		<input type="button" value="上传文件" onclick="doUpload()"/>
	</form>  -->
	<form action="http://localhost:3000/file/admin/upload" method="post" enctype="multipart/form-data">
	    <h2>单图上传</h2>
	    <input type="file" name="image">
	    <input type="submit" value="提交">
	</form> 
</body>
</html>
